﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Pku.BookStore.IServices;
using Pku.BookStore.Model;

namespace Pku.BookStore.Services
{
    [Serializable]
    [ServiceBehavior(IncludeExceptionDetailInFaults = true, ConcurrencyMode = ConcurrencyMode.Multiple)]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class OrderDetailServices : IOrderDetailServices
    {
        /// <summary>
        /// 获取实例名
        /// </summary>
        private DAL.OrderDetailDAL orderDetailDAL
        {
            get
            {
                return new DAL.OrderDetailDAL();
            }
        }

        /// <summary>
        /// 增加订单详情信息
        /// </summary>
        /// <param name="entity"></param>
        public int Add(OrderDetailModel entity)
        {
            return orderDetailDAL.Add(entity);
        }

        /// <summary>
        /// 修改订单详情信息
        /// </summary>
        /// <param name="entity"></param>
        public bool Modify(OrderDetailModel entity)
        {
            return orderDetailDAL.Modify(entity);
        }

        /// <summary>
        /// 搜索订单详情
        /// </summary>
        /// <returns></returns>
        public List<OrderDetailModel> Search(OrderDetailParam param)
        {
            return orderDetailDAL.Search(param);
        }

        /// <summary>
        /// 获取订单详情实体
        /// </summary>
        /// <param name="orderID"></param>
        /// <returns></returns>
        public OrderDetailModel GetEntityById(int orderID)
        {
            return orderDetailDAL.GetEntityById(orderID);
        }

        /// <summary>
        /// 获取订单详情实体
        /// </summary>
        /// <param name="orderID"></param>
        /// <returns></returns>
        public List<OrderDetailModel> GetListById(int orderID)
        {
            return orderDetailDAL.GetListById(orderID);
        }

    }
}
